<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>易居</title>
    <link rel="stylesheet" href="../css/zlh_bootstrap.min.css">
    <link rel="stylesheet" href="../css/zlh_main.css">
    <style>
        body {
            background-color: #f5f5f5;
        }
    </style>
    <script>
        function displayInfo() {
            document
        }
    </script>
</head>
<body>

    <div class="col-sm-2" th:fragment="side" >
        <script>
            window.onload = function getURL() {
                var url = document.location.toString();
                var arrUrl = url.split("//");

                var start = arrUrl[1].indexOf("/");
                var relUrl = arrUrl[1].substring(start);//stop省略，截取从start开始到结尾的所有字符

                if(relUrl.indexOf("?") != -1){
                    relUrl = relUrl.split("?")[0];
                }
                //alert(relUrl);
                if (relUrl == "/user/update_user_before")
                {
                    document.getElementById("edit").setAttribute("class","list-group-item text-center active");
                }
                else if (relUrl == "/user/center")
                {
                    document.getElementById("index").setAttribute("class","list-group-item text-center active");
                }
                else if (relUrl == "/user/user_appointment_list")
                {
                    document.getElementById("lookhousetime").setAttribute("class","list-group-item text-center active");
                }
            }
        </script>
        <div class="side-bar-card2 clearfix">
            <div class="card-title" th:text="${'欢迎你，'+ user.userName}">欢迎你，姚家勋</div>
            <div class="card-body">
                <div class="list">
                    <a id="index" href="/user/center" target="iframe_a" class="list-group-item text-center">首页</a>
                    <a href="#" class="list-group-item text-center">待看清单</a>
                    <a id="lookhousetime" href="/user/user_appointment_list" class="list-group-item text-center">看房日程</a>
                    <a href="#" class="list-group-item text-center">关注的房源</a>
                    <a href="#" class="list-group-item text-center">关注的小区</a>
                    <a id="edit" href="/user/update_user_before" class="list-group-item text-center">编辑资料</a>
                </div>
            </div>
        </div>
    </div>

</body>
</html>